<div id="addMachineModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">
                    <span><vc:i18n name="添加设备" namespace="addMachine"></vc:i18n></span>
                </h3>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="设备编码" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addMachineInfo.machineCode" type="text"
                                           :placeholder="vc.i18n('必填，请填写设备编码','addMachine')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="版本号" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addMachineInfo.machineVersion" type="text"
                                           :placeholder="vc.i18n('必填，请填写版本号','addMachine')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="设备名称" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addMachineInfo.machineName" type="text"
                                           :placeholder="vc.i18n('必填，请填写设备名称','addMachine')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="设备类型" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model.trim="addMachineInfo.typeId"
                                            @change="setAddMachineTypeCd(addMachineInfo.typeId)">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填','addMachine')}}，请选择设备类型
                                        </option>
                                        <option v-for="(item,index) in addMachineInfo.machineTypes" :key="index"
                                                :value="item.typeId">
                                            {{item.machineTypeName}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row" v-if="addMachineInfo.isShow == 'true'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="设备方向" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model.trim="addMachineInfo.direction">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填，请选择设备方向','addMachine')}}
                                        </option>
                                        <option value="3306">{{vc.i18n('进场','addMachine')}}</option>
                                        <option value="3307">{{vc.i18n('出场','addMachine')}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="厂家" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addMachineInfo.authCode" type="text"
                                           :placeholder="vc.i18n('必填，请填写厂家','addMachine')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="设备位置" namespace="addMachine"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model.trim="addMachineInfo.locationTypeCd">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填，请选择设备位置','addMachine')}}
                                        </option>
                                        <option v-for="item in addMachineInfo.locations"
                                                :value="item.locationId">
                                            {{item.locationName}}-->{{item.locationObjName}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">
                                <span><vc:i18n name="设备" namespace="addMachine"></vc:i18n></span>IP
                            </label>
                            <div class="col-sm-10">
                                <input v-model.trim="addMachineInfo.machineIp" type="text"
                                       :placeholder="vc.i18n('选填，请填写设备IP,如 192.168.1.10:8090','addMachine')"
                                       class="form-control">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-2 col-form-label">
                                <span><vc:i18n name="设备" namespace="addMachine"></vc:i18n></span>MAC
                            </label>
                            <div class="col-sm-10">
                                <input v-model.trim="addMachineInfo.machineMac" type="text"
                                       :placeholder="vc.i18n('选填，请填写设备MAC','addMachine')" class="form-control">
                            </div>
                        </div>
                        <div v-for="(item,index) in addMachineInfo.attrs">
                            <div class="form-group row" v-if="item.specType == '2233'">
                                <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                <div class="col-sm-10">
                                    <input v-model.trim="item.value" type="text" :placeholder="item.specHoldplace"
                                           class="form-control">
                                </div>
                            </div>
                            <div class="form-group row" v-if="item.specType == '3344'">
                                <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model.trim="item.value">
                                        <option selected disabled value="">{{item.specHoldplace}}</option>
                                        <option v-for="value in item.values" :label="value.valueName"
                                                :value="value.value">
                                            {{item.valueName}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <button class="btn btn-primary float-right" type="button" v-on:click="saveMachineInfo()">
                                <i class="fa fa-check"></i>&nbsp;保存
                            </button>
                            <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                    data-dismiss="modal">
                                <span><vc:i18n name="取消" namespace="addMachine"></vc:i18n></span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>